/**
 * Created by 周颖 on 2018/1/8.
 *
 * axios post请求默认提交的是JSON,如果需要提交 application/x-www-form-urlencoded =>
 * 1、引入 import queryString from 'querystring';
 * 2、参数 queryString.stringify(para)
 * [参考](https://github.com/mzabriskie/axios#using-applicationx-www-form-urlencoded-format)
 *
 *
 * [接口地址](http://59.107.26.181:8086/swagger-ui.html)
 */

import axios from 'axios';


let api = {
  getCompanyList: '/api-trade/v1/api/backend/company/list',
  update: '/api-trade/v1/api/backend/company/update',
  create: '/api-trade/v1/api/backend/company/create'
}

const getCompanyList = (params) => {
  return axios.get(api.getCompanyList + '?id=' + params.id + '&name=' + params.name + '&pageSize=' + params.pageSize + '&curPage=' + params.curPage)
}

const update = (params) => {
  return axios.post(api.update, params)
}

const create = (params) => {
  return axios.post(api.create, params)
}

export {
  api,
  getCompanyList,
  update,
  create
}
